
//打开报价信息
function clientPriceInfo(){
	var url="";
	var data="";
	var object = $("#bag").html("");
	//打开客户报价信息表
	object.load("clientCostPrice",function(response,status,xhr) {
		var data="clientName=&currentPages=";
		showAllClientPriceCost(data);
	});
}

//显示所有客户报价信息
function showAllClientPriceCost($proData){
			//获取查询条件
			//var proData = $("#supProductIn").val();
			
			//获取路径
			var url="/trade-wzj-web/ClientInfoQuotaControllerYang/findClientQuota";
			var tst = postMethod(url,"POST",$proData);
			
			var ts=tst.list;
			var object =$("#costAllClientTable tbody").html("");
			//支付状态
			var payStates = "";
			var str="";
			//总价格
			var totalPrice="";
			for(var i=0;i<ts.length;i++){
				var sts=ts[i].productInfoQuota;
				//获取支付状态信息
				var pay = ts[i].paystate;
				for(var a=0;a<pay.length;a++){
					payStates=payStates+
						"<option value="+pay[a].payID+">"+pay[a].payStateName+"</option>";
					
				}
				var k=1;
				for(var j=0;j<sts.length;j++){
					k=i+1;
					str=str+
					"<tr>"+
				
						"<td><label>"+
					      "<input type='checkbox' name='supplierSproductId' value="+sts[i].productInfoQuotaID+">"+
					    "</label></td>"+
					      							"<td>1</td>"+
					      							"<td>1</td>"+
					      							"<td>1</td>"+
					      							
					      							
					      							"<td>1</td>"+
					      							"<td style='text-align:center'><a href='#'><span class='glyphicon glyphicon-pencil'></span></a></td>"+
						"</tr>";
					totalPrice = totalPrice+sts[i].rental;
			}
			}
			$("#payCondition").html(payStates);
			object.append(str);
			//调用页面显示
			var listPage = getAllClientPricePage(tst);
			var al = $("#clientPricePage").html("");
			al.append(listPage);
		}

//获取页码信息
function getAllClientPricePage($clientList){
	var page="";
	
	var con = $("#supProductNames").val();
	page = page+"<div class='row' style='margin:0px'>" +
	"<div class='col-md-2 col-sm-2 col-xs-2' style='padding-top:0.7rem'>"+
		"<span style='font-weight:bold'>总记录数 "+$clientList.total+"   |  总页数 "+$clientList.pages+"</span>"+
	"</div>"+
	"<div class='col-md-offset-8 col-sm-offset-8 col-xs-offset-8'>"
	+"<nav aria-label='Page navigation'>"+
"<ul class='pagination pagination-sm'>";
	if($clientList.prePage>0){
		page = page+"<li><a href='#' onclick='getPagesSAllProductPrice("+$clientList.firstPage+",\""+con+"\")'>首页</a></li>"+
		"<li><a href='#' onclick='getPagesSAllProductPrice("+$clientList.prePage+",\""+con+"\")'>上一页</a></li>";
				
	}
	if($clientList.nextPage<=$clientList.lastPage && $clientList.nextPage>0){
		page = page+"<li><a href='#' onclick='getPagesSAllProductPrice("+$clientList.nextPage+",\""+con+"\")'>下一页</a></li>"+
		"<li><a href='#' onclick='getPagesSAllProductPrice("+$clientList.lastPage+",\""+con+"\")'>末页</a></li>";
	}
	page = page+"</li>"+
"</ul>"+
"</nav>"+
"</div>"+
"</div>";
	return page;
	
}



//点击分页按钮
function getPagesSAllProductPrice($page,$obj){
	var data="name="+$obj+"&currentPages="+$page;
	showSupProduct(data);
}